package com.example.activity;

import com.example.model.LocationListAdapter;
import com.example.model.LocationModel;
import com.example.test.R;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;

public class LocationView extends Activity {
	private ListView locationList;
	private LocationModel locModel;
	private Cursor mCursor;
	private ImageButton back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.location_view);
		
		locModel=new LocationModel(this);
		mCursor=locModel.select();
		
		locationList=(ListView)findViewById(R.id.list_location);
		locationList.setAdapter(new LocationListAdapter(this,mCursor));
		
		back=(ImageButton)findViewById(R.id.btn_back_location);
		back.setOnClickListener(new OnClickListener()
		{

			@Override
			public void onClick(View v) {
				finish();
				
			}
			
		});
	}

}
